// 引入ztree相关的页面
import '../module/ztreeDemo/ztreeModule';
export default (ngModule, Angular) => {
  ngModule.config(['$stateProvider', '$locationProvider', '$urlRouterProvider', function ($stateProvider, $locationProvider, $urlRouterProvider) {
    $stateProvider.state('feng.ztree', {
      url: '/ztree',
      templateProvider: ['$q', function ($q) {
        let deferred = $q.defer();
        require.ensure(['../module/ztreeDemo/ztree_main.html'], function () {
          let template = require('../module/ztreeDemo/ztree_main.html');
          deferred.resolve(template);
        });
        return deferred.promise;
      }],
      controller: 'ztreeCtrl',
      resolve: {
        foo: ['$q', '$ocLazyLoad', function ($q, $ocLazyLoad) {
          let deferred = $q.defer();
          require.ensure([], function () {
            $ocLazyLoad.load({
              name: 'ztreeApp'
            });
            deferred.resolve();
          });
          return deferred.promise;
        }]
      }
    });
  }]);
}